/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package VO;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Julian
 */
@Entity
@Table(name = "tipopago")
@NamedQueries({
    @NamedQuery(name = "Tipopago.findAll", query = "SELECT t FROM Tipopago t"),
    @NamedQuery(name = "Tipopago.findByIdtipoPago", query = "SELECT t FROM Tipopago t WHERE t.idtipoPago = :idtipoPago"),
    @NamedQuery(name = "Tipopago.findByNombre", query = "SELECT t FROM Tipopago t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "Tipopago.findByCosto", query = "SELECT t FROM Tipopago t WHERE t.costo = :costo"),
    @NamedQuery(name = "Tipopago.findByFilas", query = "SELECT t FROM Tipopago t WHERE t.filas = :filas")})
public class Tipopago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idtipoPago")
    private Integer idtipoPago;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "costo")
    private int costo;
    @Basic(optional = false)
    @Column(name = "filas")
    private int filas;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTipoPago")
    private Collection<Pagos> pagosCollection;

    public Tipopago() {
    }

    public Tipopago(Integer idtipoPago) {
        this.idtipoPago = idtipoPago;
    }

    public Tipopago(Integer idtipoPago, String nombre, int costo, int filas) {
        this.idtipoPago = idtipoPago;
        this.nombre = nombre;
        this.costo = costo;
        this.filas = filas;
    }

    public Integer getIdtipoPago() {
        return idtipoPago;
    }

    public void setIdtipoPago(Integer idtipoPago) {
        this.idtipoPago = idtipoPago;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public int getCosto() {
        return costo;
    }

    public void setCosto(int costo) {
        this.costo = costo;
    }

    public int getFilas() {
        return filas;
    }

    public void setFilas(int filas) {
        this.filas = filas;
    }

    public Collection<Pagos> getPagosCollection() {
        return pagosCollection;
    }

    public void setPagosCollection(Collection<Pagos> pagosCollection) {
        this.pagosCollection = pagosCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtipoPago != null ? idtipoPago.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tipopago)) {
            return false;
        }
        Tipopago other = (Tipopago) object;
        if ((this.idtipoPago == null && other.idtipoPago != null) || (this.idtipoPago != null && !this.idtipoPago.equals(other.idtipoPago))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "VO.Tipopago[idtipoPago=" + idtipoPago + "]";
    }

}
